package com.hackordie.daos.mappers;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.hackordie.commons.hardware.components.HardDisk;

public class HardDiskMapper implements RowMapper<HardDisk> {

	@Override
	public HardDisk mapRow(final ResultSet result, final int row) throws SQLException {
	    	    
	    HardDisk hardDisk = new HardDisk(result.getString("name"), 
	                                     result.getInt("energyTurnOn"),
	                                     result.getInt("capacity"),
	                                     result.getInt("prize"));
	    
	    hardDisk.setIdComponent(result.getInt("idComponent"));	    
		return hardDisk;
	}

}
